#include "trainer.h"
#include <iostream>
#include <cassert>

Trainer::Trainer(QDomNode& node) {
	
	QDomElement elem = node.namedItem("number").toElement();
	assert(!elem.isNull());
	m_number = static_cast<int>(elem.text());
	
	elem = node.namedItem("name").toElement();
	assert(!elem.isNull());
	m_name = elem.text();
	
	elem = node.namedItem("type").toElement();
	assert(!elem.isNull());
	m_type = elem.text();
	
	elem = node.namedItem("rating").toElement();
	assert(!elem.isNull());
	m_rating = static_cast<int>(elem.text());
	
	elem = node.namedItem("price").toElement();
	assert(!elem.isNull());
	m_price = static_cast<int>(elem.text());
}